import request from '@/utils/request'

const api_name= "/eduservice/teacher"

export default{

    //1. 讲师列表（条件查询分页）
    //current当前页 limit每页记录数 teacherQuery 条件对象
    getTeacherListPage(current,limit,teacherQuery){
        return request({
            //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
            // 这个写法 不能用单引号或双引号 而是反引号`
            url: `${api_name}/pageTeacherCondition/${current}/${limit}`,
            method: 'post',
            data: teacherQuery
        })
    },
    // 删除讲师
    deleteTeacherId(id){
        return request({
            url: `${api_name}/${id}`,
            method: 'delete'
        })
    },
    // 添加讲师
    addTeacher(teacher){
        return request({
            url: `${api_name}/addTeacher`,
            method: 'post',
            data: teacher
        })
    },
    // 根据id 获取讲师
    getTeacherInfo(id){
        return request({
            url: `${api_name}/getTeacher/${id}`,
            method: 'get',
        })
    },
    // 修改讲师
    updateTeacher(teacher){
        return request({
            url: `${api_name}/updateTeacher`,
            method: 'post',
            data: teacher
        })
    },
  getList() {
    return request({
      url: `${api_name}/findAll`,
      method: 'get'
    })
  },
}
